#include <iostream>
#include <thread>
#include <future>
using namespace std;


void Add(promise<int>& prom)
{
    prom.set_value(11 + 22);
    return;
}

int main()
{
    promise<int> prom;
    future<int> fu = prom.get_future();
    thread th(Add, ref(prom));

    cout << fu.get() << endl;

    th.join();
    return 0;
}